Process Platform Case Plug-in |
The cordys.case plug-in is used to interact with the Process Platform Case engine. It can be used to perform a few tasks such as starting a case, workflow tasks, and handling a specific case instance. This plug-in uses the cordys.ajax plug-in to invoke the Web services.
Methods
The following methods are supported by the cordys.case plug-in:
Table 1. List of Methods
Method |
Description |
---|---|
createCase(caseModel, caseVariables, caseData, options) |
Creates a Case instance |
getActivityDefinition(caseInstance,activityid, options) |
Retrieves the complete definition of the activity |
getActivityInstance(caseInstance, activityinstanceid, options) |
Provides the details of an instance of an activity |
getActivityInstances(caseInstance, options) | Provides the details of the activity instances, which are triggered by the Case instance |
getBusinessEvents(caseInstance,activityid,options) |
Provides all the business events, which are allowed to be raised from an activity |
getCaseData(caseInstance, options) |
Retrieves the data associated with a specified Case instance |
getCaseInstance(caseInstance, options) |
Retrieves the details of a Case instance |
getCaseVariables(caseInstance, options) |
Retrieves the details of the Case variable associated with the Case model |
getFollowupActivities(caseInstance,activityid, options) |
Returns all the follow-up activities of an activity instance |
planActivities(caseInstance, activities,options) |
Plans a set of activities for a Case instance |
planIntermediateActivities(caseInstance, activityinstanceid, activityId, activities, options) |
Plans the Intermediate follow-up type of activities for a Case instance |
sendEvent(caseInstance, eventName, activityid, options) |
Sends a business event to a Case instance |
updateCaseData(caseInstance, caseData, options) |
Updates the data of a Case instance |
updateCaseVariables(caseInstance, caseVariables,lockid, options) |
Updates the Case variables associated with a Case instance |
Note:
- All the caseInstance parameters can either be a complete CaseInstance object or a string containing the identifier of the instance.
- All the option parameters are a collection of properties that are sent to the cordys.ajax call. You can provide the instance-specific parameters or a method to be invoked on completion. For more information, refer to Process Platform Ajax Plug-in.
- For more information on the Case APIs, refer to Case Management SOAP APIs.
Return types
All the methods in the case plug-in return a jQuery XHR
object, which is the same as the object returned by the cordys.ajax plug-in.
Authentication
The cordys.authentication plug-in handles the authentication for connecting to the Process Platform server. For more information, refer to Authenticating Users with HTML5 SDK.
Examples
The following are the sample code snippets:
$.cordys.case.createCase("ClaimCase", null, { data: { "@xmlns:ns": "http://myinsurance/claim/1.0", "@name": "ClaimDetails", "ns:ClaimDetails": { "ns:ClaimAmount": $("#claimAmount").val(), "ns:CustomerID": $("#customerID").val(), "ns:PolicyID": $("#policyID").val(), "ns:PolicyType": $("#policyType").val() } } });
$.cordys.case.getCaseData(caseInstance).done(function(data) { // do something with the data of the caseInstance });
$.cordys.case.getActivityDefinition(caseInstance,"activityid").done(function(activities) { // do something with the activity definitions });
$.cordys.case.getActivityDefinition(caseInstance,{"activityid_1","activityid_2"}).done(function(activities) { // do something with the activity definitions });
$.cordys.case.getActivityInstance(caseInstance,activityInstanceId).done(function(activityInstance) { // do something with the activity instance data });
$.cordys.case.getFollowupActivities(caseInstance,activityid).done(function(followups) { // do something with the follow up activities });
var activities = [{ "@id": "activity1_ID", "@name": "Duplicate Check", "@state":"Registration", "@allowmultiplan": "true"}, {"@id": "activity2_ID","@name": "Assign Investigator","@state": "Registration","@allowmultiplan": "true"}]; $.cordys['case'].planActivities(caseInstance,activities).done(function (states) { // do something with the existing active states of the Case model }